package cn.com.w.bootdemo.controller;


import cn.com.w.commons.base.util.ShutdownContext;
import cn.com.w.commons.base.vo.ResponseBaseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app")
public class ShutdownAppController {


    @Autowired
    ShutdownContext shutdownContext;


    @PostMapping("/shutdown")
    public ResponseBaseVO shutdownApp(){
        ResponseBaseVO responseBaseVO = ResponseBaseVO.ok();

        shutdownContext.shutdown();

        return responseBaseVO;
    }
}
